package com.itheima.wms.utils;

import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class Result<T> {
    private int code;
    private T data;
    private String msg;

    public static <T> Result<T> success(T data) {
        return new Result<>(0, data, "ok");
    }

    public static <T> Result<T> fail(String msg) {
        return new Result<>(-1, null, msg);
    }
}
